{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Bootstrapping\n",
    "\n",
    "Example of bootstrapping the confidence interval for the mean of a sample distribution\n",
    "Since no bootstrapping is implemented in Python, this function requires\n",
    "\"bootstrap.py\", which is included.\n",
    "\n",
    "Note: The original scikits-bootstrapping module, which works only under\n",
    "Python 2, is available from http://github.org/cgevans/scikits-bootstrap\n",
    "   \n",
    "Author:  Thomas Haslwanter, Date:    Feb-2017"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import scipy as sp\n",
    "import matplotlib.pyplot as plt\n",
    "from scipy import stats\n",
    "import scikits.bootstrap as bootstrap"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "slideshow": {
     "slide_type": "subslide"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x27e6c3619e8>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEICAYAAABRSj9aAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXt4XWWV8H/rXNKWEtoSQpsCbYlixQTlEjXVGaajMLZY\nVHycDxGvWKpz8zLOOMjnh5UZkZnP+dQZR7HDOKC2iBeqTMdWRUFEm0IjDKQgCIHeSNs0pLS0pcnJ\nWd8fe+/TfXb2Pmefk3OSdHf9nidPzn6v613vetfZZ+2TLFFVDMMwjOSSmmgBDMMwjPpijt4wDCPh\nmKM3DMNIOOboDcMwEo45esMwjIRjjt4wDCPhmKOvABG5RUT+wX29WER21GHcPxSRx2sxrjveehF5\nn/v6/SJyX63GrkKWe0Rkecy2NdOv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ESvM84IZtOETnBtXNvzYndZx+V\n7utPgD8RkVnuJ6E/ccvqz0Q/4Ag87LgEeAJ4CvjfEy1PDdf1Bzgf6x4GHnJ/LsGJTf4c+D1wF3Cy\n215wvoH0FPAIzjcaJnwdY1j/YmCd+7oVuB94EvgeMMUtn+peP+nWt0603FWu9Vxgs7vXPwRmJX2f\ngc8CvwN6gG8BU5K2z8BtOM8ghnE+uX2wmn0FrnLX/iTwgfGS3/4FgmEYRsKZTKEbwzAMow6YozcM\nw0g45ugNwzASjjl6wzCMhGOO3jAMI+GYozcMw0g45ugNwzASzv8H2odUKh6Q1p4AAAAASUVORK5C\nYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x27e66339550>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Generate a non-normally distributed datasample\n",
    "data = stats.poisson.rvs(2, size=1000)\n",
    "\n",
    "# Show the data\n",
    "plt.plot(data, '.')\n",
    "plt.title('Non-normally distributed dataset: Press any key to continue')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false,
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The conficence intervals for the mean are: 2.001 - 2.179\n"
     ]
    }
   ],
   "source": [
    "# Calculate the bootstrap\n",
    "CIs = bootstrap.ci(data=data, statfunction=sp.mean)\n",
    "\n",
    "# Print the data: the \"*\" turns the array CIs into a list\n",
    "print('The conficence intervals for the mean are: {0} - {1}'.format(*CIs))"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Slideshow",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
